package ModelRepresentations;

public class EdgeModelObject {
	ModelObject modelObject;
	
	ModelObject from; // the node the edge goes from
	ModelObject to; // the node the edge goes to
	
	/**
	 * creates an instance of the EdgeModelObject class
	 * @param modelObject is the edge this class represents
	 */
	public EdgeModelObject(ModelObject modelObject){
		this.modelObject = modelObject;
	}
	
	/**
	 * creates an instance of the EdgeModelObject class
	 * @param modelObject is the edge this class represents
	 * @param from is the node this edge extends from
	 * @param to is the node this edge extends to
	 */
	public EdgeModelObject(ModelObject modelObject, ModelObject from, ModelObject to){
		this.modelObject = modelObject;
		this.from = from;
		this.to = to;
	}
	
	/**
	 * gets the ModelObject that represents this edge
	 * @return a ModelObject
	 */
	public ModelObject getModelObject() {
		return modelObject;
	}
	
	/**
	 * sets the ModelObject that represents this edge
	 * @param a ModelObject
	 */
	public void setModelObject(ModelObject modelObject) {
		this.modelObject = modelObject;
	}
	
	/**
	 * gets the ModelObject representing the node the edge extends from
	 * @return a ModelObject
	 */
	public ModelObject getFrom() {
		return from;
	}
	
	/**
	 * sets the ModelObject representing the node the edge extends from
	 * @param a ModelObject
	 */
	public void setFrom(ModelObject from) {
		this.from = from;
	}
	
	/**
	 * gets the ModelObject representing the node the edge extends to
	 * @return a ModelObject
	 */
	public ModelObject getTo() {
		return to;
	}
	
	/**
	 * sets the ModelObject representing the node the edge extends to
	 * @param a ModelObject
	 */
	public void setTo(ModelObject to) {
		this.to = to;
	}
	
	/**
	 * gets the unique id for the node that the edge extends from
	 * @return a string representing the unique id
	 */
	public String getFromUniqueID(){
		return from.getUniqueID();
	}
	
	/**
	 * gets the unique id for the node that the edge extends to
	 * @return a string representing the unique id
	 */
	public String getToUniqueID(){
		return to.getUniqueID();
	}
	
	/**
	 * gets this edges unique id
	 * @return a unique id
	 */
	public String getEdgeUniqueID(){
		return this.modelObject.getUniqueID();
	}
}
